package com.service.impl;

import com.bean.Provider;
import com.dao.ProviderMapper;
import com.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

/**
 * 供应商业务逻辑实现
 */
@Service("providerService")
public class ProviderServiceImpl implements ProviderService {

    @Autowired
    private ProviderMapper providerMapper;

    @Override
    public int save(Provider provider) {
        return providerMapper.insert(provider);
    }

    @Override
    public int remove(Provider provider) { return providerMapper.delete(provider); }

    @Override
    public int modify(Provider provider) { return providerMapper.update(provider); }

    @Override
    public List<Provider> find(Provider provider) { return providerMapper.select(provider); }

    @Override
    public int count(Map<String, Object> map) { return providerMapper.selectCount(map); }

    @Override
    public List<Provider> query(Map<String, Object> map) { return providerMapper.selectByPage(map); }
}
